/**
	@file DialogNavigator.h
	@author Przemyslaw Plutecki, Maciej Siczek
*/
#ifndef DIALOGNAVIGATOR_H
#define DIALOGNAVIGATOR_H
#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_list.hpp>
#include <QDialog>

namespace LightChart
{
	/**
		@class DialogNavigator
		@author Przemyslaw Plutecki, Maciej Siczek
		@version 1.0
		@brief Manages GUI windows by arranging their appearance order. It uses Singleton design pattern.
	*/
    class DialogNavigator : public boost::ptr_list<QDialog>, public boost::noncopyable
    {
	public:
	/**
		@brief Use to get the instance.
		@return DialogNavigator's instance reference
	*/
    static DialogNavigator& get_instance();
	/**
		@brief Shows the window that is first in appearance sequence.
	*/
    void launch();
    /**
    	@brief Inserts given window at the end of the appearance sequence.
    	@param d inserted dialog window
    */
    void set_next(QDialog* d) { push_back(d); }
    QDialog& get_next() const; ///< @brief returns following window's reference. @return reference to the next window in the sequence.
    void next(); ///< @brief jumps to the following window, by showing it and hiding the current one.
    void previous(); ///< @brief jumps to the previous window @see next()
	private:
    iterator current;
	DialogNavigator() {}
    };
}


#endif // DIALOGNAVIGATOR_H
